﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Clien_Default : System.Web.UI.Page
{
    Service.Service s;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Student"] == null)
        {
            Response.Redirect("LoginStudent.aspx");
        }
        else
        {
            s = new Service.Service();
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string namestudent = Session["Student"].ToString();
        int CodeProfileStudent = s.SP_CodeProfileStudent(namestudent);
        string NameTeachers = DropDownList2.SelectedItem.Text;
        int CodeProfile = s.CodeProfileTeachers(NameTeachers);
        string CodeSubjects1 = Request.QueryString["NameSubjects"].ToString();
        int CodeSchoolSubjects = s.CodeSubjects(CodeSubjects1);
        string Month = TextBox3.Text;
        string Punctual = RadioButtonList1.SelectedItem.Text;
        string Convered = RadioButtonList2.SelectedItem.Text;
        string Skills = RadioButtonList4.SelectedItem.Text;
        string Support = RadioButtonList5.SelectedItem.Text;
        string Remarks = txtRemarks.Text;
        s.AddFeedBack(CodeProfile, CodeSchoolSubjects, CodeProfileStudent, Month, Punctual, Convered, Skills, Support, Remarks);
        Response.Redirect("ListSubject.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        if (Session["Student"] == null)
        {
            Response.Redirect("LoginStudent.aspx");
        }
        else
        {
            Response.Redirect("ListSubject.aspx");
        }

    }
}